package com.itboye.lottery.widget.medium_textview;

import android.content.Context;
import android.util.AttributeSet;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

/**
 * MediumTextView
 * <p>
 * Created by Mr.w on 2018/9/11.
 * <p>
 * 版本      ${version}
 * <p>
 * 修改时间
 * <p>
 * 修改内容
 */

public class MediumTextView extends ElementView {
    public MediumTextView(Context context) {
        super(context, null);
    }

    public MediumTextView(Context context, AttributeSet attrs) {
        super(context, attrs, null);
    }

    @Override
    public void render() {
        setOrientation(VERTICAL);
    }

    public void setText(String html) {
        Document document = Jsoup.parse(html);
        Element element = document.body();
        setElement(element);
        Utils.appendView(this, getElement().children());
        invalidate();
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
    }
}
